<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>
<link href="${ctx.resource}/css/credit-mall.css" rel="stylesheet">
<title>兑换列表</title>

</head>
<body>
  <div class="page-group">
    <div class="page page-current ft-background">
      <div class="content">
        <c:choose>
          <c:when test="${not empty creditOrders}">
            <div class="mall-list record-list-wrap">
          <div class="list-block media-list" id="scroller-box" style="position: absolute; top: 0; overflow: hidden; right: 0; left: 0; bottom: 0;">
            <ul class="scroller" id="scroller">
              <c:forEach items="${creditOrders }" var="co">
                <li><a href="${ctx.host}/profile/credit-orders/${co.id}" class="item-content">
                    <div class="item-media">
                      <img src="${cloud.prod}/${co.product.cover}" class="product-cover">
                    </div>
                    <div class="item-inner">
                      <div class="item-title-row">
                        <div class="item-title">${co.product.name}</div>
                      </div>
                      <div class="item-subtitle">
                        <span class="time">${co.exchangeTime}</span>
                      </div>
                    </div>
                    <div class="item-after">
                      <button class="button detail-button">详情</button>
                    </div>
                </a></li>
              </c:forEach>
            </ul>
            <div class="no-more hide">
              <span>你已经很努力了</span>
            </div>
          </div>
        </div>
          </c:when>
          <c:otherwise>
            <p style="text-align: center;">暂无积分兑换记录</p>
          </c:otherwise>
        </c:choose>
      </div>
    </div>
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource type="script" root="${ctx.resource}/build" src="js/page/credit/order/exchange-record-list.js" />
    <script type="text/javascript">
      require(['page/credit/order/exchange-record-list'], function(page) {
        page.init()
      })
    </script>
  </body>
</html>